// pages/book/book.js
var detail_url = 'https://app.bearead.com/bxyd/comment/commentList?token=&bid='
Page({

  onLoad: function (params) {
    wx.showToast({
      title: '加载中....',
      icon: "loading",
      duration: 10000
    });
    console.log(params)
    var data = this.data.bookData
    var newdata= data.find((i,index)=>{
      if(i.bid==params.id){
        return data[index]
      }
      else{
        return data[0]
      }
    })
    this.setData({
      nowpageData: newdata
    })
    console.log(this.data.nowpageData)

    wx.request({
      url: detail_url + params.id,
      data: {},
      header: {
        'content-type': 'application/json'
      },
      success:(res)=>{
        wx.hideToast();
        // console.log(res.data.data)
        this.setData({
          compendData: res.data.data
        })
      }
    })
  },
  onReady: function () {
    
  },

  onShow: function () {
  
  },

  onHide: function () {
  
  },
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  },
  data: {
    nowpageData:{},
    compendData:[],
    timeData:[
      "1天前", "3小时前", "5小时前", "8小时前", "2天前", "10小时前", "4小时前", "1天前", "1天前", "3小时前", "5小时前", "8小时前", "2天前", "10小时前", "4小时前", "1天前", "1天前", "3小时前", "5小时前", "8小时前", "2天前", "10小时前", "4小时前", "1天前", "1天前", "3小时前", "5小时前", "8小时前", "2天前", "10小时前", "4小时前", "1天前", "1天前", "1天前", "3小时前"
    ],
    timeData1:[
      "11月前","9月前","1年前","5月前","3月前","7月前"
    ],
    bookData: 
      [
        {
          "bid": "b11187636",
          "intro": {
            "name": "破阵图",
            "nickname": "青山荒冢",
            "intro": "微博：青山荒冢白骨哀↵菇凉们还有剩下的评论吗？行行好给点儿吧……",
            "cover": "https://chapterssl.bearead.com/b11187636/15334792084665370.jpg",
            "description": "《破阵子•百里山川横断》百里山川横断，千载史册俱焚。何必贪狼吞日月，未酬英豪葬孤峦。长恨华发生。滴水凿石穿壁，劲松覆雪逢春。一点星火燎原意，万代传灯有圣贤。敢为天下先。食用说明：1.古风架空，仙魔群像，正剧流，非傻白甜轻松向 2.双男主+副线，双重世界观，有甜有虐，作者本性难移，剧情为主，感情为辅 3.有认真考据也有私设，看文图一快，考究勿拍砖",
            "tag": [
              "剧情", "BL", "正剧", "架空", "HE", "古风", "双男主"
            ],
            "size": "6.3",
            "read_count": 33.5,
            "collect_count": "902"
          },
          "recommend": [{
            "nickname": "马木甬",
            "name": "我的小规模天国",
            "description": "平凡的高中生张盛文在一个同样平凡的午后鬼使神差地走上了学校的楼顶。在那里，他遇见了神秘的同校生戴颖。被神秘少女所“吸引”的张盛文从那天起，就和戴颖一起攀登这座城市里的高楼。这并不是什么大不了的事情，只是从楼下爬到楼顶而已，并不具备任何特别的意义。那么，戴颖为什么要坚持这样的行为呢？这样的行为真的是完全无意义的吗？ 最后，张盛文决定以自己的方式去寻找出真正属于自己的答案——",
            "tags": ["剧情", "搞笑", "轻松", "非感情向"],
            "cover": "https://chapterssl.bearead.com/b10073142/201707261137218856.png",
            "review_count": "308",
            "fav_count": "176"
          },
          {
            "nickname": "逡罗",
            "name": "无忧旅馆",
            "description": "在城市里流传着这样一个传说，当一个人走投无路的时候，只要走进无忧旅馆，自然会有人帮他处理掉任何麻烦，但是作为代价，他要在无忧旅馆里住满一年。白天的时候可以自由活动，但是晚上一定要回到旅馆的房间里。至于这一年的期限中无论发生什么事都不能离开无忧旅馆，否则这个人将会付出比之前更惨重的代价。",
            "tags": ["剧情", "悬疑", "非感情向", "冒险"],
            "cover": "https://chapterssl.bearead.com/b10077784/201706140929391151.png",
            "review_count": "208",
            "fav_count": "376"
          },
          {
            "nickname": "亡人越刀",
            "name": "女巫请睁眼",
            "description": "二十八线武打小明星方岱川，好不容易接到真人秀综艺《狼人杀》的常驻通告，本想借此咸鱼翻身，却被阴错阳差地卷进了一场真实的死亡游戏……方岱川：我会努力去抢镜头的！李斯年：你他妈活下来再说话！p.s.老爷子的歌我很喜欢，也非常开心大家能喜欢，但是请大家不要去歌曲下面ky刷书名了，谢谢大家。",
            "tags": ["剧情", "悬疑", "非感情向", "冒险"],
            "cover": "https://chapterssl.bearead.com/b10077824/201710292333567195.png",
            "review_count": "228",
            "fav_count": "316"
          },
          {
            "nickname": "关山遥",
            "name": "惊秋",
            "description": "喜欢用剑的男孩子，智商都不会太高。↵世家公子攻x耿直剑客受。【正文番外均完结，请趁热食用】韩璧：“这位同学，请说出你的梦想。”↵沈知秋：“愿得广厦千万间，你住一间我住一间。” 读者群：662447994 喜欢本文的话点下右上角小心心，么么哒ー´ー",
            "tags": ["剧情", "悬疑", "非感情向", "冒险", "轻松"],
            "cover": "https://chapterssl.bearead.com/b10084560/201709151915393737.png",
            "review_count": "328",
            "fav_count": "116"
          },
          {
            "nickname": "樊落",
            "name": "囧囧见鬼事件簿",
            "description": "一个怕鬼怕到死的富三代少爷每天不得不见鬼的故事，更悲催的是他身边还随时跟着一位可怕的鬼执事，总算鬼执事颜值够高，让聂二少多少有点心理安慰，可是鬼执事伺候他的目的好像不怎么单纯（づ￣3￣）づ╭❤～…… 微博 @樊落",
            "tags": ["双男", "HE", "非感情向", "冒险", "轻松"],
            "cover": "https://chapterssl.bearead.com/b10107289/201801051036586946.png",
            "review_count": "128",
            "fav_count": "146"
          },
          {
            "nickname": "贺兰邪",
            "name": "七号鱼馆",
            "description": "民国十七年，茶城出现许多异人，这些异人的出现让本来安宁已久的茶城再掀波澜。一件又一件的诡异非人案件出现，闹得大家人心惶惶。↵身份神秘的七号鱼馆主人，受人之托调查昔年悬案，结识了雌雄同体的盗贼邢庭，探长阳明臻上门求助，三人行破诡异奇案。这个世上，到底还有多少不可思议的怪相？",
            "tags": ["剧情", "民国", "非感情向", "冒险", "轻松"],
            "cover": "https://chapterssl.bearead.com/b10110545/201711172128532847.png",
            "review_count": "112",
            "fav_count": "131"
          }
          ]
        },
        {
          "bid": "b10119200",
          "intro": {
            "name": "逆行",
            "nickname": "池总渣",
            "intro": "微博@喵总渣",
            "cover": "https://chapterssl.bearead.com/b10170329/15266210567906548aaa",
            "description": "第一次见面，陈错想，这男人不一样，他有股劲，很鲜活，很野性。他在说话，下唇有肉，一张一合。是适合接吻的唇。再次见面，陆峥引来女人的回头。湿润蜷曲的头发在空中划出一道弧，下了场雨。目光聚焦在来人的身上时，很明显地，她双眼一亮，发起光来。老干部禁欲消防官x无性别发散魅力摄影师",
            "tag": [
              "剧情", "BL", "冒险", "架空", "古风"
            ],
            "size": "3.8",
            "read_count": 3.2,
            "collect_count": "795"
          },
          "recommend": [{
            "nickname": "柳初",
            "name": "后宫大不同",
            "description": "效仿妲己入宫倾覆暴君王朝的小狐狸在后宫经历的一系列离奇事件。 读者扣扣群：210810546 新文《仙侠大不同》火热连载中！",
            "tags": ["剧情", "民国", "非感情向", "冒险", "轻松"],
            "cover": "https://chapterssl.bearead.com/b10021739/201707262000088889.png",
            "review_count": "132",
            "fav_count": "113"
          },
          {
            "nickname": "粥四汤",
            "name": "山海饿经",
            "description": "讹兽，食之不可以言实。狌狌，食之善走。九尾狐，食者不蛊；虎蛟，食者不肿，可以已痔；鶌鶋，食之不饥，可以已寓……山海经？夏北辰一拍桌子，义愤填膺地表示，这不就是中华美食大全吗？？太犯罪了，倪高人我们走，我们去吃烧烤！！倪修只想说，妈的智障。",
            "tags": ["神话传说", "轻松", "非感情向", "冒险", "轻松"],
            "cover": "https://chapterssl.bearead.com/b10036531/201704231327472591.png",
            "review_count": "222",
            "fav_count": "313"
          },
          {
            "nickname": "沉佥",
            "name": "拣尽寒枝",
            "description": "靖王嘉斐一心恋着幼时挚友甄贤，偏偏秉性高洁的甄贤最无法忍受的便是朝堂政斗的奸诈狠毒。阴错阳差，误会重重，弄人时势推得彼此倾心的两人离离合合，竟至七年不见……这是一个王爷如何和他的好竹马携手并进，靖边关，夺天下，革吏制，杀权臣，然后又因为三观不合开始天天吵架终至家暴（雾）的故事。",
            "tags": ["架空", "古风", "非感情向", "冒险", "轻松"],
            "cover": "https://chapterssl.bearead.com/b10058392/201709111534303767.png",
            "review_count": "321",
            "fav_count": "421"
          },
          {
            "nickname": "亡人越刀",
            "name": "女巫请睁眼",
            "description": "二十八线武打小明星方岱川，好不容易接到真人秀综艺《狼人杀》的常驻通告，本想借此咸鱼翻身，却被阴错阳差地卷进了一场真实的死亡游戏……↵方岱川：我会努力去抢镜头的！李斯年：你他妈活下来再说话！p.s.老爷子的歌我很喜欢，也非常开心大家能喜欢，但是请大家不要去歌曲下面ky刷书名了，谢谢大家。",
            "tags": ["爱情", "现代", "游戏", "冒险", "轻松"],
            "cover": "https://chapterssl.bearead.com/b10077824/201710292333567195.png",
            "review_count": "231",
            "fav_count": "264"
          },
          {
            "nickname": "唐三秒",
            "name": "长安刀铃斋",
            "description": "打一把刀，拯救一个江湖。当刀挂满刀斋横梁时，阵阵刀铃声便是一切终结的挽歌。",
            "tags": ["幻想", "武侠", "复仇", "冒险", "轻松"],
            "cover": "https://chapterssl.bearead.com/b10082670/201708241624571081.png",
            "review_count": "222",
            "fav_count": "491"
          },
          {
            "nickname": "亚沙",
            "name": "不小心变成了传说大神",
            "description": "新坑《室友是行走猫薄荷》连载ing，又萌又酷的悬疑故事，不来片儿猫薄荷尝尝吗？凌柯：我是终究要成为电竞大神的男人！陆海空：大家好，我是电竞大神。凌柯：……陆海空：你能别当代打了吗？凌柯：就不，别勉强我！陆海空：你能别当主播了吗？凌柯：就不，别勉强我！陆海空：你就不能老老实实跟我合作打竞技，一起冲出中国走向世界吗？凌柯：就……↵陆海空：就个毛！老子偏要勉强！",
            "tags": ["幻想", "武侠", "复仇", "冒险", "轻松"],
            "cover": "https://chapterssl.bearead.com/b10119200/15353442319482168null",
            "review_count": "314",
            "fav_count": "198"
          }
          ]
        },
        {
          "bid": "b11172211",
          "intro": {
            "name": "直到我走了弯路",
            "nickname": "鱼八咸",
            "intro": "🐟·八咸王·祖咸",
            "cover": "https://chapterssl.bearead.com/b11172211/15289058418381003null",
            "description": "为了逃离相亲漩涡，钟午安选择出个假柜。没成想老妈看个病都能看出一场相亲，万分欣慰地告诉他：“人家是医生的儿子，品性可好着呢！你去试试！” 你不钙我我不钙你，你钙我我不钙你，我钙你你又不钙我，那我就追你。",
            "tag": [
              "爱情", "日常", "治愈", "架空"
            ],
            "size": "6.4",
            "read_count": 62,
            "collect_count": "672"
          },
          "recommend": [{
            "nickname": "蜂蜜戚风",
            "name": "喵虎",
            "description": "【新文《我师弟是女装大佬》日更中～】一个怀揣着明星梦的乡下小脑腐进城奋斗，不到两周就被人把钱骗得精光。快饿死的小脑腐去小攻家门口装小猫：“咪！”小攻：“猫是这么叫的吗？”小脑腐：“喵！”",
            "tags": ["幻想", "武侠", "复仇", "冒险", "轻松"],
            "cover": "https://chapterssl.bearead.com/b10031588/201803141135085413.png",
            "review_count": "321",
            "fav_count": "332"
          },
          {
            "nickname": "闻笛",
            "name": "糊涂镖局糊涂账",
            "description": "【武侠耽美新坑《十步一杀》隔壁日更中，本文已完结】↵中唐时的敦煌，有一家小镖局，镖局中怪人云集。有一穷二白、风流倜傥的年轻镖头。有来历不明、沉默寡言的冷面刀客。有慵懒随性、讨厌麻烦的绝色美女。彼时，武林四大家族镇守四方，维系着西域与中原的和平。在金刀袁氏的当家寿宴上，却出了一件大事。风云暗涌，惊天阴谋，且看今朝。",
            "tags": ["剧情", "历史", "轻松", "冒险"],
            "cover": "https://chapterssl.bearead.com/b10031686/15349465872482263null",
            "review_count": "212",
            "fav_count": "421"
          },
          {
            "nickname": "亡人越刀",
            "name": "刺青与蛋挞",
            "description": "一个对外威武雄壮对内软萌温柔的前黑道老大和一个外表清纯不做作内心攻气十足的女博士互相攻略的故事",
            "tags": ["爱情", "宠文", "微虐", "冒险", "轻松"],
            "cover": "https://chapterssl.bearead.com/b10036627/201708042016175419.png",
            "review_count": "123",
            "fav_count": "432"
          },
          {
            "nickname": "x马鹿君x",
            "name": "区区脂肪君居然这么帅？！",
            "description": "“你好，我是寄居在你身上的脂肪君。”“……现在可以请你滚吗？”“不，我不滚。我还要和你天长地久。”“no——！！” 读者群：624752628 欢迎来玩",
            "tags": ["爱情", "职场", "现言", "冒险", "轻松"],
            "cover": "https://chapterssl.bearead.com/b10081159/15262924450198735.jpg",
            "review_count": "221",
            "fav_count": "232"
          },
          {
            "nickname": "未水水",
            "name": "我才不要当女主呢",
            "description": "“说出来你可能不信，我是穿越的。”“好巧，我也是。”“这年头女主都是高危职业，我才不要当女主呢！合作可以，你可别爱上我！”“你的戏还能再多一点吗？”后来我才知道，我们两个是口嫌体正直双人组。这是一个穿越平行世界之后自以为是万人迷女一号最后却发现自己只是个死跑龙套的戏精自作多情史。自恋戏精女主X毒舌腹黑男主",
            "tags": ["爱情", "职场", "现言", "冒险", "轻松"],
            "cover": "https://chapterssl.bearead.com/b10088597/201803262129201804.png",
            "review_count": "341",
            "fav_count": "231"
          },
          {
            "nickname": "樊落",
            "name": "囧囧见鬼事件簿",
            "description": "一个怕鬼怕到死的富三代少爷每天不得不见鬼的故事，更悲催的是他身边还随时跟着一位可怕的鬼执事，总算鬼执事颜值够高，让聂二少多少有点心理安慰，可是鬼执事伺候他的目的好像不怎么单纯（づ￣3￣）づ╭❤～…… 微博 @樊落",
            "tags": ["爱情", "悬疑", "灵异", "冒险", "推理"],
            "cover": "https://chapterssl.bearead.com/b10107289/201801051036586946.png",
            "review_count": "134",
            "fav_count": "524"
          }
          ]
        }
      ]
  },
})